home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_Patterns / Pattern.h < prev    next >
Text File  |  1992-12-19  |  3KB  |  103 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.  *    Pattern.m
  35.  *
  36.  *    This class provides objects that correspond to patterns. It is modeled after the 
  37.  *    Font class. It not a rigorous definition but is just a vehicle for demostrating the
  38.  *    PostScript aspects of handling patterns.
  39.  *
  40.  *    Version:    2.0
  41.  *    Author:    Ken Fromm
  42.  *    History:
  43.  *            03-07-91        Added this comment.
  44.  */
  45.  
  46. #import <objc/Object.h>
  47.  
  48. #import <appkit/graphics.h>
  49. #import <appkit/color.h>
  50.  
  51. @interface Pattern : Object
  52. {
  53.     char            *name;
  54.  
  55.     float            size;
  56.  
  57.     float            *matrix;
  58.  
  59.     int            patternNum,                /*  This is the only one needed. */
  60.                 patternImageNum;            /*  This is for compositing. */
  61.  
  62.     id            image;
  63.  
  64.     NXRect        cellRect;
  65.  
  66.     struct _pFlags {
  67.         unsigned int        _RESERVED:14;
  68.         unsigned int        _matrixIsIdentity:1;
  69.         unsigned int        _matrixIsFlipped:1;
  70.     } pFlags;
  71. }
  72.  
  73. + newPattern:(const char *) patternName  size:(float) patternSize;
  74. + newPattern:(const char *) patternName  size:(float) patternSize  matrix:(const float *) patternMatrix;
  75.  
  76. /*
  77. *    This method is only for the demo program. An implementation
  78. *    in an application would probably make a decision as to
  79. *    the best pattern cell size and then use that in the +new
  80. *    methods removing this method.
  81. */
  82. - definePatternRows:(int) rows  andCols:(int) cols;
  83.  
  84. - free;
  85.  
  86. - image;
  87. - compositeTo:(NXCoord) x  :(NXCoord) y;
  88.  
  89. - (BOOL) hasMatrix;
  90. - (const float *) matrix;
  91.  
  92. - (const char *) name;
  93.  
  94. - (int) patternNum;
  95.  
  96. - (float) pointSize;
  97.  
  98. - set;
  99. - unset;
  100.  
  101. @end
  102.  
  103.